package com.example.oasystem.dao.systemcontrol;

import com.example.oasystem.entity.daymanage.AoaScheduleListOfSun;
import com.example.oasystem.entity.notepaper.AoaNotepaperOfSun1;
import com.example.oasystem.entity.notice.AoaNoticeListOfSun;
import com.example.oasystem.entity.notice.NoticeDTO;
import com.example.oasystem.entity.plan.AoaPlanListOfSun;
import com.example.oasystem.entity.process.AoaNotepaperOfSun;
import com.example.oasystem.entity.process.AoaProcess;
import com.example.oasystem.entity.status.AoaStatusList;
import com.example.oasystem.entity.type.AoaTypeList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface SystemcontrolDao {
    int selectFile(Long userId);

    int selectDirector(Long userId);

    List<AoaNoticeListOfSun> selectNotice(Long userId);

    List<AoaProcess> selectProcess(Long userId);

    List<AoaPlanListOfSun> selectPlan(Long userId);

    List<AoaTypeList> selectTypeList();

    List<AoaStatusList> selectStatusList();

    List<AoaNotepaperOfSun1> selectNotepaperList(Long userId,String concent);

    AoaPlanListOfSun selectOnePlan(long planId);

    List<AoaScheduleListOfSun> findstart(long userid);

    void addnotepaper(AoaNotepaperOfSun1 sun);

    @Select("select count(*) from aoa_user_login_record where login_time like concat('%',#{date},'%')")
    int getLoginCount(String date);

    @Select("SELECT user_name from aoa_user")
    List<String> getUserByName();

    Integer getUserTask(String userName);

    //未查看通知数量
    @Select("select count(*) from aoa_notice_user_relation where relatin_user_id = #{userId} and is_read = 0")
    Integer getNotice(int userId);

    //未查看邮件数量
    @Select("select count(*) from aoa_mail_reciver where mail_reciver_id= #{userId} and is_read = 0")
    Integer getMail(int userId);

    //新任务
    @Select("select count(*) from aoa_task_user where task_recive_user_id= #{userId} and status_id = 3")
    Integer getTask(int userId);

}
